package org.devocean.groupbuying.service;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.devocean.groupbuying.domain.Deal;
import org.devocean.groupbuying.domain.Discount;
import org.devocean.groupbuying.domain.Formula;
import org.devocean.groupbuying.domain.PurchaseItem;

public interface DealService {

	Deal getDealById(Integer id);

	Deal getDealById(Integer id, String lang);

	Deal addOrUpdateDeal(Deal deal);

	List<Deal> getAllDeals(String lang);

	List<Deal> getDealsbyTag(String lang, String tag);
	List<Deal> getDealsbyProduct(String lang, Integer productID,
			int firstResult, int maxResults);

	void removeDeal(Integer id);

	Deal getFeaturedDeal(String lang);

	List<Deal> getDealsEntries(int firstResult, int maxResults);
	List<Deal> getDealsEntries(String lang,int firstResult, int maxResults);
	List<Deal> getNewDealsEntries(String lang,int firstResult, int maxResults);
	List<Deal> getEndSoonDealsEntries(String lang,int firstResult, int maxResults);
	List<Deal> getPopularDealsEntries(String lang,int firstResult, int maxResults);

	List<Formula> getFormulasByProductId(Integer productID);

	long countDeals();

	long countDeals(String lang);
	long countDeals(String lang,Integer productID);

	List<Deal> getAllDeals();

	Deal getDealWithKey(Integer dealID, String lang);

	Discount getDiscountByDealID(Integer dealID, Integer formulaID);

	List<PurchaseItem> getPurchaseItemsByDealID(Integer DealID);

	Long expireDeals();

	Deal getDealByLang(Integer localizationKey, String localizationRequest);

	Deal getDealByArticleID(Integer id);
	
	Map<String, Object> search(String searchText, ConcurrentHashMap<String, Object> searchResult);
	

}
